
const Note = require('../model/note.model')

class noteService {
  async getNote(params){
    const { count, rows } = await Note.findAndCountAll(
      {
        limit:params.pageSize,
        offset:(params.pageNo -1) * params.pageSize 
      },
    )
    return {
      rows,
      count
    }
  }
  async addNote(params){
    const json = await Note.create(params)
    if(json){
      return true
    }
  }
}

module.exports = new noteService()